#include<bits/stdc++.h>
#define int long long
using namespace std;
inline int read() {
    int f=0,t=0;
    char c=getchar();
    while(!isdigit(c)) t|=(c=='-'),c=getchar();
    while(isdigit(c)) f=(f<<3)+(f<<1)+c-48,c=getchar();
    return t?-f:f;
}
void write(int x) {
    if(x<0) putchar('-'),x=-x;
    if(x>9) write(x/10);
    putchar('0'+x%10);
}
int n,a0,a[200005],h[200005];
int cnt[25],pd[25],ans=1e18;
void dfs(int p,int n,int ma,int sum){
//	cout<<p<<endl;
	if(sum>ans) return; 
	if(p>n){ans=min(ans,sum);return;}
	for(int i=1;i<=n;i++){
		if(pd[i]==0){
			int u=i;
			int siz=h[u]/ma;if(h[u]%ma==0) siz--;
			cnt[p]=i,pd[i]=1;
			dfs(p+1,n,max(ma,a[u]),(sum+siz*a[u]));
			pd[i]=0;
		}
	}
}
signed main(){
	freopen("xinyue.in","r",stdin);
	freopen("xinyue.out","w",stdout);
	n=read(),a0=read();
	for(int i=1;i<=n;i++) a[i]=read(),h[i]=read();
	if(n<=10){dfs(1,n,a0,0);cout<<ans;return 0;} 
	int sum=((h[1]/a0)-(h[1]%a0==0))*a[1];
	for(int i=2;i<=n;i++){
		int siz=(h[i]/a[1])-(h[i]%a[1]==0);
		sum+=siz*a[i];
	}
	int ans=sum;
	for(int i=2;i<=n;i++){
		int siz=(h[i]/a[1])-(h[i]%a[1]==0);
		sum-=siz*a[i];
		sum-=((h[1]/a0)-(h[1]%a0==0))*a[1];
		siz=(h[i]/a0)-(h[i]%a0==0);
		sum+=siz*a[i];sum+=((h[1]/a[i])-(h[1]%a[i]==0))*a[1];
		ans=min(ans,sum);
		sum-=((h[1]/a[i])-(h[1]%a[i]==0))*a[1];
		sum-=siz*a[i];siz=(h[i]/a[1])-(h[i]%a[1]==0),sum+=siz*a[i];
		sum+=((h[1]/a0)-(h[1]%a0==0))*a[1];
	}
	sum=((h[n]/a0)-(h[n]%a0==0))*a[n];
	for(int i=n-1;i;i--){
		int siz=(h[i]/a[i+1])-(h[i]%a[i+1]==0);
		sum+=siz*a[n];
	}
	cout<<min(ans,sum);
	return 0;
}
/*
10 54
43153 115592
158953 197265
149409 7216
79249 102987
94590 90473
120051 193128
24599 90898
189746 191660
114014 166590
141843 48301
*/
